import base from '../../scripts/base'
import utils from '../../scripts/utils'
import './download_new.css'


// 安卓下载按钮
let androidDownload = document.querySelector('.download-btn_android')
androidDownload.addEventListener('click', () => {
  downloadClick('android')
})

//iOS下载按钮
let iosDownLoad = document.querySelector('.download-btn_ios')
iosDownLoad.addEventListener('click', () => {
  downloadClick('ios')
})



// 下载按钮方法
let coverShadow = document.querySelector('.cover-shadow')
let downloadClick = function (how) {
  downloadUrl = "";
  if (utils.isWeChat()) {
    coverShadow.style.display = 'block'
    return
  } else if (utils.isQQ()) {
    coverShadow.style.display = 'block'
    return
  }

  if (utils.isIos() && how == 'ios') {
    var downloadUrl = "http://fir.im/5py3";
  } else if (utils.isAndroid() && how == 'android') {
    var downloadUrl = "http://cdn.hbjxqp.happypoker.cn/0/v12/hall.apk";
  }
  if (downloadUrl == "") {
    return;
  }
  window.location.href = downloadUrl;
}
